import 'package:favoritecate/core/model/category_model.dart';
import 'package:favoritecate/ui/pages/meal/meal.dart';
import 'package:flutter/material.dart';


// ignore: must_be_immutable
class FYHomeCategoryItem extends StatelessWidget {
  CategoryModel model;
  FYHomeCategoryItem(this.model);



  @override
  Widget build(BuildContext context) {
    Color bgColor = model.colorValue;
    return GestureDetector(
      child: Container(
        alignment: Alignment.center,
        decoration: BoxDecoration(
            color: bgColor,
            borderRadius: BorderRadius.circular(12),
            gradient: LinearGradient(
                colors: [
                  bgColor.withOpacity(0.5),
                  bgColor
                ]
            )
        ),
        child: Text(
          model.title,
          style: Theme.of(context).textTheme.display2.copyWith(
              fontWeight: FontWeight.bold
          ),
        ),
      ),
      onTap: (){
        print(model.title);
        Navigator.of(context).pushNamed(FYMealPage.routeName,arguments: model);
      },
    );;
  }
}